/*     */ package com.zimbra.cs.service.account;
/*     */ 
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.common.soap.AccountConstants;
/*     */ import com.zimbra.common.soap.Element;
/*     */ import com.zimbra.common.soap.Element.KeyValuePair;
/*     */ import com.zimbra.common.util.StringUtil;
/*     */ import com.zimbra.soap.DocumentDispatcher;
/*     */ import com.zimbra.soap.DocumentService;
/*     */ import java.util.HashMap;
/*     */ import java.util.Map;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class AccountService
/*     */   implements DocumentService
/*     */ {
/*     */   public void registerHandlers(DocumentDispatcher dispatcher)
/*     */   {
/*  48 */     dispatcher.registerHandler(AccountConstants.AUTH_REQUEST, new Auth());
/*  49 */     dispatcher.registerHandler(AccountConstants.CHANGE_PASSWORD_REQUEST, new ChangePassword());
/*  50 */     dispatcher.registerHandler(AccountConstants.END_SESSION_REQUEST, new EndSession());
/*     */     
/*     */ 
/*  53 */     dispatcher.registerHandler(AccountConstants.GET_PREFS_REQUEST, new GetPrefs());
/*  54 */     dispatcher.registerHandler(AccountConstants.MODIFY_PREFS_REQUEST, new ModifyPrefs());
/*     */     
/*  56 */     dispatcher.registerHandler(AccountConstants.GET_INFO_REQUEST, new GetInfo());
/*  57 */     dispatcher.registerHandler(AccountConstants.GET_ACCOUNT_INFO_REQUEST, new GetAccountInfo());
/*     */     
/*  59 */     dispatcher.registerHandler(AccountConstants.AUTO_COMPLETE_GAL_REQUEST, new AutoCompleteGal());
/*  60 */     dispatcher.registerHandler(AccountConstants.SEARCH_CALENDAR_RESOURCES_REQUEST, new SearchCalendarResources());
/*  61 */     dispatcher.registerHandler(AccountConstants.SEARCH_GAL_REQUEST, new SearchGal());
/*  62 */     dispatcher.registerHandler(AccountConstants.SYNC_GAL_REQUEST, new SyncGal());
/*     */     
/*  64 */     dispatcher.registerHandler(AccountConstants.MODIFY_PROPERTIES_REQUEST, new ModifyProperties());
/*  65 */     dispatcher.registerHandler(AccountConstants.MODIFY_ZIMLET_PREFS_REQUEST, new ModifyZimletPrefs());
/*     */     
/*  67 */     dispatcher.registerHandler(AccountConstants.GET_ALL_LOCALES_REQUEST, new GetAllLocales());
/*  68 */     dispatcher.registerHandler(AccountConstants.GET_AVAILABLE_LOCALES_REQUEST, new GetAvailableLocales());
/*  69 */     dispatcher.registerHandler(AccountConstants.GET_AVAILABLE_SKINS_REQUEST, new GetAvailableSkins());
/*  70 */     dispatcher.registerHandler(AccountConstants.GET_AVAILABLE_CSV_FORMATS_REQUEST, new GetAvailableCsvFormats());
/*     */     
/*     */ 
/*  73 */     dispatcher.registerHandler(AccountConstants.CREATE_IDENTITY_REQUEST, new CreateIdentity());
/*  74 */     dispatcher.registerHandler(AccountConstants.MODIFY_IDENTITY_REQUEST, new ModifyIdentity());
/*  75 */     dispatcher.registerHandler(AccountConstants.DELETE_IDENTITY_REQUEST, new DeleteIdentity());
/*  76 */     dispatcher.registerHandler(AccountConstants.GET_IDENTITIES_REQUEST, new GetIdentities());
/*     */     
/*     */ 
/*  79 */     dispatcher.registerHandler(AccountConstants.CREATE_SIGNATURE_REQUEST, new CreateSignature());
/*  80 */     dispatcher.registerHandler(AccountConstants.MODIFY_SIGNATURE_REQUEST, new ModifySignature());
/*  81 */     dispatcher.registerHandler(AccountConstants.DELETE_SIGNATURE_REQUEST, new DeleteSignature());
/*  82 */     dispatcher.registerHandler(AccountConstants.GET_SIGNATURES_REQUEST, new GetSignatures());
/*     */     
/*     */ 
/*  85 */     dispatcher.registerHandler(AccountConstants.GET_SHARE_INFO_REQUEST, new GetShareInfo());
/*     */     
/*     */ 
/*  88 */     dispatcher.registerHandler(AccountConstants.GET_WHITE_BLACK_LIST_REQUEST, new GetWhiteBlackList());
/*  89 */     dispatcher.registerHandler(AccountConstants.MODIFY_WHITE_BLACK_LIST_REQUEST, new ModifyWhiteBlackList());
/*     */     
/*     */ 
/*  92 */     dispatcher.registerHandler(AccountConstants.CREATE_DISTRIBUTION_LIST_REQUEST, new CreateDistributionList());
/*  93 */     dispatcher.registerHandler(AccountConstants.DISTRIBUTION_LIST_ACTION_REQUEST, new DistributionListAction());
/*  94 */     dispatcher.registerHandler(AccountConstants.GET_ACCOUNT_DISTRIBUTION_LISTS_REQUEST, new GetAccountDistributionLists());
/*  95 */     dispatcher.registerHandler(AccountConstants.GET_DISTRIBUTION_LIST_REQUEST, new GetDistributionList());
/*  96 */     dispatcher.registerHandler(AccountConstants.GET_DISTRIBUTION_LIST_MEMBERS_REQUEST, new GetDistributionListMembers());
/*  97 */     dispatcher.registerHandler(AccountConstants.SUBSCRIBE_DISTRIBUTION_LIST_REQUEST, new SubscribeDistributionList());
/*     */     
/*     */ 
/* 100 */     dispatcher.registerHandler(AccountConstants.CHECK_RIGHTS_REQUEST, new CheckRights());
/* 101 */     dispatcher.registerHandler(AccountConstants.DISCOVER_RIGHTS_REQUEST, new DiscoverRights());
/* 102 */     dispatcher.registerHandler(AccountConstants.GET_RIGHTS_REQUEST, new GetRights());
/* 103 */     dispatcher.registerHandler(AccountConstants.GRANT_RIGHTS_REQUEST, new GrantRights());
/* 104 */     dispatcher.registerHandler(AccountConstants.REVOKE_RIGHTS_REQUEST, new RevokeRights());
/*     */     
/*     */ 
/* 107 */     dispatcher.registerHandler(AccountConstants.GET_VERSION_INFO_REQUEST, new GetVersionInfo());
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static Map<String, Object> getAttrs(Element request, String nameAttr)
/*     */     throws ServiceException
/*     */   {
/* 116 */     return getAttrs(request, false, nameAttr);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static Map<String, Object> getAttrs(Element request, boolean ignoreEmptyValues, String nameAttr)
/*     */     throws ServiceException
/*     */   {
/* 125 */     Map<String, Object> result = new HashMap();
/* 126 */     for (Element.KeyValuePair pair : request.listKeyValuePairs("a", nameAttr)) {
/* 127 */       String name = pair.getKey();
/* 128 */       String value = pair.getValue();
/* 129 */       if ((!ignoreEmptyValues) || ((value != null) && (value.length() > 0)))
/* 130 */         StringUtil.addToMultiMap(result, name, value);
/*     */     }
/* 132 */     return result;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static Map<String, Object> getKeyValuePairs(Element parent, String elemName, String attrName)
/*     */     throws ServiceException
/*     */   {
/* 151 */     Map<String, Object> result = new HashMap();
/* 152 */     for (Element eKV : parent.listElements(elemName)) {
/* 153 */       String key = eKV.getAttribute(attrName);
/* 154 */       String value = eKV.getText();
/* 155 */       StringUtil.addToMultiMap(result, key, value);
/*     */     }
/* 157 */     return result;
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/account/AccountService.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */